package com.cat.net.network.kafka.serializer;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
import org.apache.kafka.common.serialization.Deserializer;

/**
 * 默认编解码器
 */
public class KafkaStreamDeserializer implements Deserializer<ByteBuf> {

    @Override
    public ByteBuf deserialize(String s, byte[] bytes) {
        ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.heapBuffer(bytes.length);
        buffer.writeBytes(bytes);
        return buffer;
    }

}
